/**
 * 商家管理相关接口
 */
import request from '@/utils/request'

/**
 * 获取商家列表
 * @param {*} query
 */
export function listbusiness(query) {
  return request({
    url: '/business/list',
    method: 'get',
    params: query
  })
}

/**
 * 删除商家
 * @param {*} data
 */
export function deletebusiness({businessId}) {
  return request({
    url: '/business/delete/' + businessId,
    method: 'delete',

  })
}

/**
 * 商家上架接口
 * @param {*} data
 */
export function publishbusiness(data) {
  return request({
    url: '/business/add',
    method: 'post',
    data
  })
}

/**
 * 获取商家详细信息
 * @param {*} id 商家id
 */
export function detailbusiness(id) {
  return request({
    url: '/business/detail',
    method: 'get',
    params: {id}
  })
}


/**
 * 更新商家信息
 * @param {*} data
 */
export function editbusiness(data) {
  return request({
    url: '/business/update',
    method: 'post',
    data
  })
}

/**
 * 获取点餐分类
 */
export function orderlist() {
  return request({
    url: '/business/orderlist',
    method: 'get'
  })
}
